var express = require('express');
var router = express.Router();

//引入模型
const classifyModel = require("../models/classify");
//请求分类列表
router.post('/tablist', function (req, res, next) {
  //get req.query
  //post req.body
  classifyModel.find({titleId:+req.body.tid},{_id:0}, (err, doc) => {
    if (err) throw err;
    console.log(doc);
    res.json({
      status: 0,
      //数据库取名list错误
      result: doc[0].lsit,
    })
  });
});


module.exports = router;